package com.bowen.chapter10.refactor;

public class Engineer {

    /**
     * 用户ID
     */
    protected int id;

    /**
     * 用户名称
     */
    protected String name;

    /**
     * 用户性别
     * 0:中 1:女 2:男
     */
    protected short genderCode;

    /**
     * 用户所在省会
     */
    protected String province;

    /**
     * 音乐家功能
     */
    protected MusicianEngineerDelegate musicianEngineerDelegate;

    /**
     * 舞蹈家功能
     */
    protected DancerEngineerDelegate dancerEngineerDelegate;


    /**
     * 唱歌
     * 只不过在调用的时候注意两点
     * 1.调用前先判断是否存在代理对象
     * 2.每次调用需要转发调用
     */
    public void singSong() {
        if (this.musicianEngineerDelegate != null) this.musicianEngineerDelegate.singSong();
    }

    /**
     * 跳舞
     */
    public void dance() {
        if (this.dancerEngineerDelegate != null) this.dancerEngineerDelegate.dance();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public short getGenderCode() {
        return genderCode;
    }

    public void setGenderCode(short genderCode) {
        this.genderCode = genderCode;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }
}
